package com.tank.control;


import com.tank.entrity.GameObject;
import com.tank.entrity.Tank;

public class TankTankCollider implements Collider {
    @Override
    public boolean collide(GameObject o1, GameObject o2) {
        if (o1 instanceof Tank && o2 instanceof Tank) {
            if (((Tank) o1).getTankRectangle().intersects(((Tank) o2).getTankRectangle())) {
                ((Tank) o1).back();
                ((Tank) o2).back();
            }
        }
        return false;
    }
}
